@extends('layout.userinfo')
@section('content')
    <div class="sidebar" role="complementary" ng-hide="layoutState &amp;&amp; layoutState.hideSidebar">
        <div class="sidebar-tabs">
            <div class="toolbar-tabs-middle">
                <a class="toolbar-btn icon-order toolbar-close" href="/profile/order" hardjump="" tooltip="我的订单" tooltip-placement="left" ubt-click="toolbar_order">
                    <!-- ngIf: sidebarCount.uncompletedOrder > 0 --></a>
                <div class="toolbar-separator"></div>
                <a class="toolbar-cartbtn icon-cart toolbar-open" href="JavaScript:" template="cart" ng-class="{'focus': (activeTemplate === 'cart' &amp;&amp; isSidebarOpen), 'toolbar-cartbtn-shownum': foodCount.count}" ubt-click="390">购物车
                    <!-- ngIf: foodCount.count --></a>
                <div class="toolbar-separator"></div>
                <a class="toolbar-btn icon-notice toolbar-open modal-hide" href="JavaScript:" template="message" ng-class="{'focus': (activeTemplate === 'message' &amp;&amp; isSidebarOpen), 'toolbar-open': user, 'modal-hide': user}" tooltip="我的信息" tooltip-placement="left" ubt-click="392">
                    <!-- ngIf: messageCount.count --></a>
            </div>
            <div class="toolbar-tabs-bottom">
                <div class="toolbar-btn icon-QR-code">
                    <div class="dropbox toolbar-tabs-dropbox">
                        <a href="http://static11.elemecdn.com/eleme/desktop/mobile/index.html" target="_blank"><img src="//faas.elemecdn.com/desktop/media/img/appqc.95e532.png" alt="下载手机应用" /><p>下载手机应用</p><p class="icon-QR-code-bonus">即可参加分享红包活动</p></a>
                    </div>
                </div>
                <a class="toolbar-btn sidebar-btn-backtop icon-top" tooltip="回到顶部" title="回到顶部" href="JavaScript:" tooltip-placement="left" style="visibility: hidden;"></a>
            </div>
        </div>
        <div class="sidebar-content">
            <!-- ngInclude: activeTemplate ? ('/common/page/_block/sidebar/sidebar-'+ activeTemplate + '/sidebar-'+ activeTemplate + '.html') : '' -->
        </div>
    </div>
            <div class="profile-panel" role="main">
                <!-- ngIf: pageTitleVisible -->
                <h3 ng-if="pageTitleVisible" class="profile-paneltitle ng-scope"><span ng-bind="pageTitle" class="ng-binding">近三个月订单</span> <span class="subtitle ng-binding" ng-bind-html="pageSubtitle | toTrusted"></span></h3>
                <!-- end ngIf: pageTitleVisible -->
                <div class="profile-panelcontent" ng-transclude="">
                    <div class="order-fetchtakeout ng-scope ng-isolate-scope" show-fetch-takeout-dialog="">
                        <img src="//faas.elemecdn.com/desktop/media/img/takeout.408a87.png" />
                    </div>
                    <div class="order-extra ng-scope">
                        <a href="/support/question/hotissue" target="_blank">热门问题</a>
                        <a href="//static11.elemecdn.com/eleme/desktop/mobile/index.html" target="_blank">随时关注订单状态</a>
                    </div>
                    <div class="loading ng-binding ng-isolate-scope ng-hide" loading="" ng-show="!orderList">
                        <!-- ngIf: type==='profile' -->
                        <img ng-if="type==='profile'" src="//faas.elemecdn.com/desktop/media/img/profile-loading.4984fa.gif" alt="正在加载" class="ng-scope" />
                        <!-- end ngIf: type==='profile' -->
                        <!-- ngIf: type==='normal' -->正在载入数据...
                    </div>
                    <div class="order-nocontent nodata ng-isolate-scope ng-hide" ng-show="orderList &amp;&amp; !orderList.length" nodatatip="" content="暂无记录，现在就去&lt;a href='/place'&gt;订餐&lt;/a&gt;吧!">
                        <p class="nodata-container ng-binding" ng-bind-html="content | toTrusted">暂无记录，现在就去<a href="/place">订餐</a>吧!</p>
                    </div>
                    <table class="order-list ng-scope" ng-show="orderList.length">
                        <thead>
                        <tr>
                            <th>下单时间</th>
                            <th class="order-list-infoth">订单内容</th>
                            <th></th>
                            <th>支付金额（元）</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr></tr>
                        @foreach($res as $val)
                        <tr class="timeline" order-timeline="" ng-repeat="item in orderList">
                            <td class="ordertimeline-time"><p class="ordertimeline-title ng-binding" ng-bind="item.created_at | parseDate"></p><p ng-bind="item.created_at | date:'HH:mm'" class="ng-binding">{{$val->time}}</p>
                                <i class="ordertimeline-time-icon icon-uniE65E finish ng-scope" ng-if="item.realStatus === 5"></i>
                                </td>
                            <td class="ordertimeline-avatar"><a  href="/shopp/{{$val->mid}}"><img ng-src="{{$val->photo}}?imageMogr2/thumbnail/70x70/format/webp/quality/85" src="{{$val->photo}}?imageMogr2/thumbnail/70x70/format/webp/quality/85" /></a></td>
                            <td class="ordertimeline-info"><h3 class="ordertimeline-title"><a ng-href="/shopp/{{$val->mid}}" ng-bind="item.restaurant.name" class="ng-binding" href="/shopp/{{$val->mid}}">{{$val->name}}1份</a>
                                    </h3><p class="ordertimeline-info-food"><span class="ordertimeline-food ng-binding" ng-bind="item.product"></span>
                                     <span class="ordertimeline-info-productnum ng-binding" ng-bind="item.productnum">1</span> <span>个菜品</span></a></p><p>订单号:{{$val->dnh}}</a></p></td>
                            <td class="ordertimeline-amount"><h3 class="ordertimeline-title ordertimeline-price ui-arial ng-binding" ng-bind="item.total_amount.toFixed(2)">{{$val->money}}元</h3><p ng-bind="item.is_online_paid ? '在线支付' : '货到付款'" class="ng-binding">在线支付</p></td>
                            @if($val->status ==1)
                            <td class="ordertimeline-status"><h3 ng-bind="item.statusText" ng-class="{'waitpay': (item.realStatus === 1), 'end': (item.realStatus === 5)}" class="ng-binding end">订单已派送</h3>
                            @endif
                            @if($val->status ==2)
                                <td class="ordertimeline-status"><h3 ng-bind="item.statusText" ng-class="{'waitpay': (item.realStatus === 1), 'end': (item.realStatus === 5)}" class="ng-binding end">订单未派送</h3>
                            @endif
                            <td class="ordertimeline-handle"><a class="ordertimeline-handle-detail" href="/pingjia/{{$val->mid}}/{{$val->name}}">订单评价</a>

                            </td>
                            </td>
                        </tr>
                            @endforeach
                        </tbody>
                    </table>
                    <div pagination="order" pagination-context="pageContext" pagination-onchange="onOrderPageChange()" class="ng-scope pagination">
                        <ul></ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection